package com.supreme.orderserver.datamapper;

import com.supreme.common.dto.LoginUser;
import com.supreme.commonentity.mysql.primary.SysUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.time.LocalDateTime;

@Mapper(componentModel = "spring", imports = {LocalDateTime.class})
public interface UserDtoMapper {

//    @Mapping(target = "id", ignore = true)
//    @Mapping(target = "createTime", expression = "java(LocalDateTime.now())")
    @Mapping(source = "username", target = "username")
    @Mapping(source = "password", target = "password")
    LoginUser mappingToLoginUser(SysUser user);
}
